/***********************************************************************
    filename:   DaterMainCalendarMonthWindow.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines class for MainCalendarMonthWindow objects in UI
*************************************************************************/
#ifndef _DaterMainCalendarMonthWindow_h_
#define _DaterMainCalendarMonthWindow_h_

#include "DaterMainWindow.h"
#include "DaterEvent.h"
#include "DaterMainCalendarWindow.h"

#include <vector>
#include <string>

//class CalendarManagerWindow;

class MainCalendarMonthWindow : public MainCalendarWindow
{
	/* !
	\brief
		The Main Calendar Month Window.
	*/
public:
		/* !
		\brief
			Construct the sample of class MainCalendarMonthWindow.

		\param id_name
			- a string to represent the prefix of the window.
			
		\param parent
			- point to parent window.
		*/
	MainCalendarMonthWindow(const CEGUI::String& id_name, CEGUI::Window* parent = 0);
	
		/* !
			Destructor of class MainCalendarMonthWindow.
		*/
	~MainCalendarMonthWindow();

		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to show window.
		*/
	virtual void showWindow();
	
		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to hide window.
		*/
	virtual void hideWindow();

		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to get head text.
		*/
	virtual std::string getHeadText();
	
		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to set to next.
		*/
	virtual bool setToNext(const CEGUI::EventArgs &args);

		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to set to previous.
		*/
	virtual bool setToPrevious(const CEGUI::EventArgs &args);

		/* !
		\brief
			a virtual function generated from class MainCalendarWindow to refresh the event.
		*/
	virtual void refreshEvent();

private:	
		/* !
		\brief
			Member to subscribe handler to each 'slot' in the layout.
		*/
    void subscribeEvents();

	bool handle_ClickOnDayBlock(const CEGUI::EventArgs& args);

	bool handle_ClickOnDayNum(const CEGUI::EventArgs& args);

	void addEventToWindow(CEGUI::Window*, std::vector<Dater::Event*>);

	int* _previousMonthData;
	CEGUI::Window* _currentDayBlock;
	int* _nextMonthData;

	int _year;

	int _month;
};

#endif